//
// Created by Administrator on 2025/3/20.
//

#include "ui_elf_data_sync.h"
void ui_elf_data_sync_screen_init(ui_elf_game_main_screen_t *screen){
    lv_coord_t screen_width = lv_disp_get_hor_res(NULL);
    lv_coord_t screen_height = lv_disp_get_ver_res(NULL);
    if(screen->screen == NULL) {
        if (screen->group == NULL) {
            screen->group = ui_set_indev_group(indev_keypad);
        }
        screen->screen = ui_create_default_screen(lv_scr_act());

        // 屏幕panel
        lv_obj_t *main_panel = ui_create_default_without_flex_panel(screen->screen);

        // image
        lv_obj_t *image = ui_create_default_image_by_src(main_panel, &elf_data_sync_img);

    }

}

void ui_elf_data_sync_screen_show(elf_game_module_t *module){
    LOG_INFO_WRAPPER("start");
    if(module){
        if(module->screen->screen == NULL){
            ui_elf_data_sync_screen_init(module->screen);
        }
    }
    module->screen->deinit_cb = ui_elf_data_sync_screen_deinit;
}

void ui_elf_data_sync_screen_deinit(){
    LOG_INFO_WRAPPER("start");
    ui_screen_group_deinit_common(&(elf_game_module.screen->screen), &(elf_game_module.screen->group));
}

